#include<iostream>
#include<algorithm>
using namespace std;
const int N = 110;
struct S
{
	int f, t;
}s[N];
int n, s1;
int cmp(S a, S b)
{
	return a.f > b.f;
}
int main()
{
	cin >> n >> s1;
	for (int i = 0; i < n; ++i) {
		int f, t;
		cin >> f >> t;
		s[i] = { f,t };
	}
	sort(s, s + n, cmp);
	int ans = 0;
	int temp = s1;
	int ma = 0;
	int k1 = 0;
	for (int i = 0; i < n; i++) {
		ans += temp - s[i].f;
		if (s[i].t > ans) {
			ans += s[i].t - ans;
		}
		temp = s[i].f;
	}
	cout << ans + s[n-1].f << endl;
	return 0;
}